package com.example.zhihuhelpapp;

import android.app.Application;

import com.example.zhihuhelpapp.utils.CoreLib;
import com.example.zhihuhelpapp.utils.LogUtils;
import com.pgyersdk.PgyerActivityManager;
import com.pgyersdk.crash.PgyCrashManager;
import com.pgyersdk.crash.PgyerCrashObservable;
import com.pgyersdk.crash.PgyerObserver;
import com.tencent.mmkv.MMKV;

public class CustomApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        CoreLib.init(this);
        // 蒲公英注册
        PgyCrashManager.register();
        PgyerCrashObservable.get().attach((thread, throwable) -> {
            throwable.printStackTrace();
            LogUtils.i("异常线程：" + thread.getName() + " 程序异常：" + throwable.getMessage());
        });
        PgyerActivityManager.set(this);

        MMKV.initialize(this);
    }
}
